<?php

namespace App\Models;

use Database\Factories\BankCardFactory;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Carbon;

/**
 * App\Models\BankCard
 *
 * @property int $id
 * @property int $type
 * @property int $user_id
 * @property string $name
 * @property string $no
 * @property string $description
 * @property Carbon|null $created_at
 * @property Carbon|null $updated_at
 * @property-read User $user
 * @method static BankCardFactory factory(...$parameters)
 * @method static Builder|BankCard newModelQuery()
 * @method static Builder|BankCard newQuery()
 * @method static Builder|BankCard query()
 * @method static Builder|BankCard whereCreatedAt($value)
 * @method static Builder|BankCard whereDescription($value)
 * @method static Builder|BankCard whereId($value)
 * @method static Builder|BankCard whereName($value)
 * @method static Builder|BankCard whereNo($value)
 * @method static Builder|BankCard whereType($value)
 * @method static Builder|BankCard whereUpdatedAt($value)
 * @method static Builder|BankCard whereUserId($value)
 * @mixin Eloquent
 */
class BankCard extends Model
{
    use HasFactory;

    protected $fillable = ['name', 'no', 'type', 'description'];

    /**
     *  属于用户
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
